import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/components/Home'

import Introduce from '@/components/System/Introduce'
import User from '@/components/System/User'
import Role from '@/components/System/Role'
import Menu from '@/components/System/Menu'

import Folder from "@/components/System/Menu/Folder"
import Button from "@/components/System/Menu/Button"
import MenuDetail from "@/components/System/Menu/MenuDetail"
import NoPermission from "@/components/NoPermission"

Vue.use(Router)

export default new Router({
  routes: [

    {
      path: '/',
      name: 'Login',
      component: Login
    }, {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/introduce',
          name: 'Introduce',
          component: Introduce
        },
        {
          path: '/sys/user',
          name: 'User',
          component: User
        },

        {
          path:"/nopermission",
          name: 'NoPermission',
          component: NoPermission
        },

        {
          path: '/sys/role',
          name: 'Role',
          component: Role
        },
        {
          path: '/sys/menu',
          name: 'Menu',
          component: Menu,
          props: true,
          children: [
            {
              path: '/menu/button',
              name: 'Button',
              component: Button,
              props: true
            },
            {
              path: '/menu/menu',
              name: 'MenuDetail',
              component: MenuDetail,
              props: true
            },
            {
              path: '/menu/folder',
              name: 'Folder',
              component: Folder,
              props: true
            }
          ]
        }

      ]
    }

  ],
  "mode": "history"
})
